import pandas as pd
from io import StringIO
from sklearn import linear_model
import matplotlib.pyplot as plt
import numpy

data =pd.read_csv('test1.csv')
plt.scatter(data.活动推广费,data.销售额)
plt.show

u=data.corr()
print(u)

x=data.活动推广费
y=data.销售额


lrModel = linear_model.LinearRegression()
lrModel.fit(x.values.reshape(-1,1),y)
lrModel.predict([[60]])
alph = lrModel.intercept_
beta = lrModel.coef_
new_r=alph+beta*numpy.array([60])
